package JSwing;

import java.util.concurrent.*;

public class MyThreadPool {

    private static ExecutorService executor;

    static {

        executor = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors() + 1,
                24,
                90,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(4096),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy());


    }

    public MyThreadPool() {

    }


    public static ExecutorService getExecutor() {
        return executor;
    }

    public static void setExecutor(ExecutorService executor) {
        MyThreadPool.executor = executor;
    }
}
